From 9f3382613afed378fbb3fedebabadb6013dddac6 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Nov 2004 06:20:33 +0000 Subject: [PATCH] Allow unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) 2004-11-03 Matthias Clasen * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) --- ChangeLog | 3 +++ ChangeLog.pre-2-10 | 3 +++ ChangeLog.pre-2-6 | 3 +++ ChangeLog.pre-2-8 | 3 +++ gtk/gtklabel.c | 5 ++++- 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 61c83ea521..03fa58ae92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-11-03 Matthias Clasen + * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow + unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) + * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash if the active_row reference has become invalid. (#157156, Christophe Fergeau) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 61c83ea521..03fa58ae92 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,8 @@ 2004-11-03 Matthias Clasen + * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow + unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) + * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash if the active_row reference has become invalid. (#157156, Christophe Fergeau) diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 61c83ea521..03fa58ae92 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,8 @@ 2004-11-03 Matthias Clasen + * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow + unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) + * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash if the active_row reference has become invalid. (#157156, Christophe Fergeau) diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 61c83ea521..03fa58ae92 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,8 @@ 2004-11-03 Matthias Clasen + * gtk/gtklabel.c (gtk_label_set_pattern_internal): Allow + unsetting a pattern by passing NULL. (#156720, Tristan Van Berkom) + * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash if the active_row reference has become invalid. (#157156, Christophe Fergeau) diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 7ae2fb0b95..066e29f2e1 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -1281,7 +1281,10 @@ gtk_label_set_pattern_internal (GtkLabel *label, PangoAttrList *attrs; g_return_if_fail (GTK_IS_LABEL (label)); - attrs = gtk_label_pattern_to_attrs (label, pattern); + if (pattern) + attrs = gtk_label_pattern_to_attrs (label, pattern); + else + attrs = NULL; if (label->effective_attrs) pango_attr_list_unref (label->effective_attrs); -- 2.30.2